Repository navigation
Conversation
A second sign-up with the same email and a different name renamed the participant, so every earlier sign-up showed the new name on the Responses tab, in the CSV, on its edit page and in its reminder and moved-slot emails. Commitments now keep the name typed for them (migration 0016 adds a nullable commitments.name), and every place that shows a sign-up's name reads it, falling back to the participant's name on sign-ups made before the column existed. A move keeps the old commitment's name unless it sends a new one, and an edit link's name change renames only that sign-up. Fixes #847. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SW4BpjDT3i5gNqu4jM
Tophat: passedRan 2efe578 locally with
For the owner (UX): when one email signs up more than once under different names (a parent signing up two children), each sign-up now keeps the name typed for it. Before, the latest name overwrote all of them. This shows on the Responses tab, in the CSV, on each edit link's page, and in that sign-up's confirmation, reminder and moved-slot emails. Renaming through one edit link renames only that sign-up. Sign-ups made before this change still show the email's latest name. The privacy page's "Display name" line now says the name is kept with each slot. Compare Screenshots are in https://claude.ai/code/session_016YZ9SV5XQwymu5dEGyVa11. Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
Review: passed (round 1)
This PR adds a nullable commitments.name. commitParticipantToSlot writes it in the commitment insert it already does, so the sign-up request sends no extra statement. A move keeps the old commitment's name (read in the cancel's RETURNING) unless it sends a new one, and an edit link's rename sets that commitment's name only. Every place that shows a sign-up's name now reads it through one expression, commitmentName (coalesce(commitments.name, participants.name)): the Responses tab and CSV, the edit page, and the confirmation, reminder and slot-change emails. I checked the claims one by one:
- A grep for
participants.name/participant.namefinds no reader outsidecommitmentName. - No MCP tool reads commitments, so there's no MCP read to change.
- The
0016snapshot is the0015snapshot pluscommitments.nameand nothing else, so the columns waiting to be dropped stay in it. - The migration is a single
ADD COLUMN, safe on a populated table and fine for the old build still serving during a deploy. - Every "Done when" item has a test. The reminder test greets the first name, and the existing "refused" and "move renames" tests pass unchanged.
Blocking (0): none.
Optional (1):
src/services/commitments.ts:863checksdata.name ?where the participant write just above uses!== undefined. With the name schema refusing an empty string, the two agree today.
Earlier threads: none. Copilot couldn't review this PR because the review quota had run out.
Checks: CI is green on 2efe578: lint-type-test, e2e and CodeQL. Locally I read the diff, compared the migration snapshots and grepped for the remaining name reads; I didn't need to run anything else. The tophat passed on this same SHA, with no runtime change since.
For the owner (UX): each sign-up now keeps the name typed for it, so a parent signing up two children with one email sees both names. Before, the latest name overwrote all of them. This shows on the Responses tab, in the CSV, on each edit page and in that sign-up's emails. The privacy page's "Display name" line changes too, and its "Last updated" date is bumped. Compare the tophat's 1092-before-responses with 1092-after-responses, and 1092-before-edit-alex with 1092-after-phone-edit-alex.
https://claude.ai/code/session_016YZ9STWK7w2mdP5AWU63DZ
Generated by Claude Code
Fixes #847.
The problem
A participant is one row per signup and email, with one
name. When someone signed up for a second slot with the same email and a different name (a parent signing up two children),commitParticipantToSlotoverwrote that name. After that, every earlier sign-up showed the new name: on the Responses tab, in the CSV, on its edit page, and in its reminder and moved-slot emails. The first name wasn't stored anywhere.The fix
0016_commitment_nameadds a nullablecommitments.name. There's no backfill.commitParticipantToSlotwrites the name typed for each sign-up in the insert it already does, so the sign-up request sends no extra statement. On a move, the new commitment takes the name the move sends. If the move sends none, it keeps the old commitment's name (keptName, read in the cancel'sRETURNING).participants.nameis still updated to the latest name typed, as before.commitmentName(src/lib/commitment-name.ts), which iscoalesce(commitments.name, participants.name). It's used bylistCommitmentsForSignup(the Responses tab and the CSV),getOwnCommitment(the edit page) andloadCommitmentRow(the confirmation, reminder and slot-change emails). Sign-ups made before this change have no name of their own, so they show what they show today.namestays off the public commitment fields. Participants already get the name asparticipantName, so the API's shape doesn't change.Decision the issue didn't cover:
drizzle-kit generatealso wanted to drop the nine columns taken out of the schema in #1003, #1013 and #1085. Those drops are meant to wait for a later release. To leave them out, I put those columns back in the schema for the generate step only, then removed them again. The new migration is a singleADD COLUMN. Its snapshot is the0015snapshot pluscommitments.name, so the later drop migration will still pick up those columns.The issue's outline also named an MCP read of commitments. No MCP tool reads commitments today, so there was nothing to change there.
Tests
commitments.db.test.tshas a new group, "one email signing up under two names". In it, Alex signs up for slot A and Sam for slot B with one email. The tests check:listCommitmentsForSignup,responsesCsvandgetOwnCommitmenteach show the right name on each row.reminders.db.test.ts: the reminder for the first slot greets the first name. Without the fix this test fails (checked).public-commitment.test.tslistsnameas a server-only column.pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test(3776 passed), andpnpm test:db(905 passed, query budget included).Session: https://claude.ai/code/session_016YZ9SW4BpjDT3i5gNqu4jM
Generated by Claude Code